CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3)
PROJECT(CircleFitting)

##################################################
# make configure
##################################################
set(CMAKE_BUILD_TYPE "Release")

if( CMAKE_BUILD_TYPE STREQUAL "Debug" )
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -g -Wall -Wno-unused-variable -pthread")
else( CMAKE_BUILD_TYPE STREQUAL "Debug" )
        set(CMAKE_BUILD_TYPE "Release")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O3 -pthread -fopenmp")
endif( CMAKE_BUILD_TYPE STREQUAL "Debug" )

message("Build Type:" ${CMAKE_BUILD_TYPE} ${CMAKE_CXX_FLAGS})

list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules )

##################################################
# Qt5
##################################################
# Find the QtWidgets library
find_package(Qt5Widgets)
find_package(Qt5Core)
include_directories(${QT_USE_FILE})

set(CUDA_USE_STATIC_CUDA_RUNTIME OFF)
set(CMAKE_AUTOMOC ON)

##################################################
# Ceres
##################################################
find_package( Ceres REQUIRED )
include_directories( ${CERES_INCLUDE_DIRS} )


##################################################
# Build
##################################################
aux_source_directory(${PROJECT_SOURCE_DIR}/src SOURCES_FILE)
ADD_EXECUTABLE(${PROJECT_NAME} ${SOURCES_FILE})
target_link_libraries(${PROJECT_NAME} ${Qt5Widgets_LIBRARIES} ${Qt5Core_LIBRARIES} ${CERES_LIBRARIES})
